//
//  UUProductUpdateRequestModel.m
//  UUCharterSupplier
//
//  Created by ZhangAo on 28/02/2018.
//  Copyright © 2018 UUCharter. All rights reserved.
//

#import "UUProductUpdateRequestModel.h"

@implementation UUProductUpdateRequestModel

- (instancetype)init {
    self = [super init];
    if (self) {
        [self addIgnoredObjects:@[@"productId"]];
        
        [self addManualMappingDict:@{
                                     @"fleetId" : @"motorcade_id",
                                     @"carCategoryId" : @"busCategoryId",
                                     }];
    }
    return self;
}

- (NSString *)url {
    return [NSString stringWithFormat:@"chartered_vehicle/%@", self.productId];
}

- (DKHTTPMethod)HTTPMethod {
    return DKHTTPMethodPut;
}

- (Class)responseModelClass {
    return [UUResponseModel class];
}

- (Class)classAtInsideOfObjectWithProperty:(NSString *)propertyName {
    if ([propertyName isEqualToString:@"spec"]) {
        return [UUProductSpecModel class];
    } else {
        return [super classAtInsideOfObjectWithProperty:propertyName];
    }
}

@end

@implementation UUProductAddRequestModel

- (instancetype)init {
    self = [super init];
    if (self) {
        [self addIgnoredObjects:@[@"productId"]];
    }
    return self;
}

- (NSString *)url {
    return [NSString stringWithFormat:@"chartered_vehicle"];
}

- (DKHTTPMethod)HTTPMethod {
    return DKHTTPMethodPost;
}

@end
